﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebUtils;

namespace OAuth
{
    /// <summary>
    /// represents a session with the service provider, facilitates the signing of authorized requests
    /// </summary>
    public interface IOAuthSession
    {
        IOAuthSessionParameter OAuthSessionParameter { get; }

        /// <summary>
        /// starts the session, does athentication if it needs to
        /// </summary>
        void StartSession();

        /// <summary>
        /// clears the old session, and start a new one
        /// </summary>
        void RefreshSession();

        /// <summary>
        /// Analyzes a web method request, computes the signature, and makes the oauth parameters available
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        ISignedWebRequest SignWebRequest(IWebRequest pRequest);
    }
}
